

export const toast = (str) => {
    const id = 'toast' + Math.random().toString(36).substring(2, 9);
    const el = document.createElement('div');
    const bulid = (str) => {
        el.className = "my-toast zoomIn"
        el.id = id
        el.innerHTML = `<div>${str}<div>`
        document.body.appendChild(el)
        console.log('这是open方法');

        setTimeout(() => {
            el.className = "my-toast zoomOut";
        }, 2000);

        setTimeout(() => {
            document.body.removeChild(el);
        }, 3000)
    }

    bulid(str)
}
